Rename domid field in Xen domain struct.
void startup_cpu_idle_loop(void)
{
/* Just some sanity to ensure that the scheduler is set up okay. */
- ASSERT(current->domain == IDLE_DOMAIN_ID);
+ ASSERT(current->id == IDLE_DOMAIN_ID);
domain_unpause_by_systemcontroller(current);
__enter_scheduler();
extern void physdev_init_dom0(struct domain *);
/* Sanity! */
- if ( p->domain != 0 )
+ if ( p->id != 0 )
BUG();
if ( test_bit(DF_CONSTRUCTED, &p->flags) )
BUG();
#define IDLE0_TASK(_t) \
{ \
processor: 0, \
- domain: IDLE_DOMAIN_ID, \
+ id: IDLE_DOMAIN_ID, \
mm: IDLE0_MM, \
thread: INIT_THREAD, \
flags: 1<<DF_IDLETASK, \
#ifdef VERBOSE
#define MEM_LOG(_f, _a...) \
printk("DOM%u: (file=memory.c, line=%d) " _f "\n", \
- current->domain , __LINE__ , ## _a )
+ current->id , __LINE__ , ## _a )
#else
#define MEM_LOG(_f, _a...) ((void)0)
#endif
*/
dom_xen = alloc_domain_struct();
atomic_set(&dom_xen->refcnt, 1);
- dom_xen->domain = DOMID_XEN;
+ dom_xen->id = DOMID_XEN;
/*
* Initialise our DOMID_IO domain.
*/
dom_io = alloc_domain_struct();
atomic_set(&dom_io->refcnt, 1);
- dom_io->domain = DOMID_IO;
+ dom_io->id = DOMID_IO;
/* M2P table is mappable read-only by privileged domains. */
for ( mfn = virt_to_phys(&machine_to_phys_mapping[0<<20])>>PAGE_SHIFT;
percpu_info[cpu].foreign = dom_io;
break;
default:
- MEM_LOG("Dom %u cannot set foreign dom\n", d->domain);
+ MEM_LOG("Dom %u cannot set foreign dom\n", d->id);
okay = 0;
break;
}
{
MEM_LOG("Bad page values %08lx: ed=%p(%u), sd=%p,"
" caf=%08x, taf=%08x\n", page_to_pfn(page),
- d, d->domain, nd, x, page->u.inuse.type_info);
+ d, d->id, nd, x, page->u.inuse.type_info);
spin_unlock(&d->page_alloc_lock);
put_domain(e);
return 0;
case MMUEXT_REASSIGN_PAGE:
if ( unlikely(!IS_PRIV(d)) )
{
- MEM_LOG("Dom %u has no reassignment priv", d->domain);
+ MEM_LOG("Dom %u has no reassignment priv", d->id);
okay = 0;
break;
}
{
MEM_LOG("Bad page values %08lx: ed=%p(%u), sd=%p,"
" caf=%08x, taf=%08x\n", page_to_pfn(page),
- d, d->domain, nd, x, page->u.inuse.type_info);
+ d, d->id, nd, x, page->u.inuse.type_info);
okay = 0;
goto reassign_fail;
}
/* This will only come out once. */
printk("Audit %d: type count whent below zero pfn=%x "
"taf=%x otaf=%x\n",
- d->domain, page-frame_table,
+ d->id, page-frame_table,
page->u.inuse.type_info,
page->tlbflush_timestamp);
}
/* This will only come out once. */
printk("Audit %d: general count whent below zero pfn=%x "
"taf=%x otaf=%x\n",
- d->domain, page-frame_table,
+ d->id, page-frame_table,
page->u.inuse.type_info,
page->tlbflush_timestamp);
}
if ( (pt[i] & _PAGE_PRESENT) &&
((pt[i] >> PAGE_SHIFT) == xpfn) )
printk(" found dom=%d i=%x pfn=%lx t=%x c=%x\n",
- d->domain, i, pfn, page->u.inuse.type_info,
+ d->id, i, pfn, page->u.inuse.type_info,
page->count_info);
unmap_domain_mem(pt);
}
if ( (page->u.inuse.type_info & PGT_validated) != PGT_validated )
printk("Audit %d: L2 not validated %x\n",
- d->domain, page->u.inuse.type_info);
+ d->id, page->u.inuse.type_info);
if ( (page->u.inuse.type_info & PGT_pinned) != PGT_pinned )
printk("Audit %d: L2 not pinned %x\n",
- d->domain, page->u.inuse.type_info);
+ d->id, page->u.inuse.type_info);
else
adjust( page, -1, 1 );
if ( (l1page->u.inuse.type_info & PGT_type_mask) ==
PGT_l2_page_table )
printk("Audit %d: [%x] Found %s Linear PT "
- "t=%x pfn=%lx\n", d->domain, i,
+ "t=%x pfn=%lx\n", d->id, i,
(l1pfn==pfn) ? "Self" : "Other",
l1page->u.inuse.type_info,
l1pfn);
else if ( (l1page->u.inuse.type_info & PGT_type_mask) !=
PGT_l1_page_table )
printk("Audit %d: [%x] Expected L1 t=%x pfn=%lx\n",
- d->domain, i,
+ d->id, i,
l1page->u.inuse.type_info,
l1pfn);
if ( (page->u.inuse.type_info & PGT_validated) != PGT_validated )
printk("Audit %d: L1 not validated %x\n",
- d->domain, page->u.inuse.type_info);
+ d->id, page->u.inuse.type_info);
#if 0
if ( (page->u.inuse.type_info & PGT_pinned) != PGT_pinned )
printk("Audit %d: L1 not pinned %x\n",
- d->domain, page->u.inuse.type_info);
+ d->id, page->u.inuse.type_info);
#endif
pt = map_domain_mem( pfn<<PAGE_SHIFT );
(l1page->u.inuse.type_info & PGT_type_mask) ==
PGT_l2_page_table )
printk("Audit %d: [%x] Ilegal RW t=%x pfn=%lx\n",
- d->domain, i,
+ d->id, i,
l1page->u.inuse.type_info,
l1pfn);
{
printk("Audit %d: [%lx,%x] Skip foreign page dom=%lx "
"pfn=%lx c=%08x t=%08x m2p=%lx\n",
- d->domain, pfn, i,
+ d->id, pfn, i,
(unsigned long)l1page->u.inuse.domain,
l1pfn,
l1page->count_info,
if ( (io_mappings > 0) || (lowmem_mappings > 0) )
printk("Audit %d: Found %d lowmem mappings and %d io mappings\n",
- d->domain, lowmem_mappings, io_mappings);
+ d->id, lowmem_mappings, io_mappings);
/* PHASE 2 */
if ( (page->u.inuse.type_info & PGT_count_mask) != 0 )
{
printk("Audit %d: type count!=0 t=%x ot=%x c=%x pfn=%lx\n",
- d->domain, page->u.inuse.type_info,
+ d->id, page->u.inuse.type_info,
page->tlbflush_timestamp,
page->count_info, pfn );
scan_for_pfn_remote(pfn);
if ( (page->count_info & PGC_count_mask) != 1 )
{
printk("Audit %d: gen count!=1 (c=%x) t=%x ot=%x pfn=%lx\n",
- d->domain,
+ d->id,
page->count_info,
page->u.inuse.type_info,
page->tlbflush_timestamp, pfn );
adjust(&frame_table[pagetable_val(d->mm.pagetable)>>PAGE_SHIFT], 1, 1);
- printk("Audit %d: Done. ctot=%d ttot=%d\n",d->domain, ctot, ttot );
+ printk("Audit %d: Done. ctot=%d ttot=%d\n", d->id, ctot, ttot );
if ( d != current )
domain_unpause(d);
ret = 0;
- op->u.createdomain.domain = d->domain;
+ op->u.createdomain.domain = d->id;
copy_to_user(u_dom0_op, op, sizeof(*op));
}
break;
for_each_domain ( d )
{
- if ( d->domain >= op->u.getdomaininfo.domain )
+ if ( d->id >= op->u.getdomaininfo.domain )
break;
}
read_unlock_irqrestore(&tasklist_lock, flags);
- op->u.getdomaininfo.domain = d->domain;
+ op->u.getdomaininfo.domain = d->id;
op->u.getdomaininfo.flags =
(test_bit(DF_DYING, &d->flags) ? DOMFLAGS_DYING : 0) |
if ( unlikely((mpfn + j) >= max_page) )
{
DPRINTK("Domain %u page number out of range (%08lx>=%08lx)\n",
- d->domain, mpfn + j, max_page);
+ d->id, mpfn + j, max_page);
return i;
}
page = &frame_table[mpfn + j];
if ( unlikely(!get_page(page, d)) )
{
- DPRINTK("Bad page free for domain %u\n", d->domain);
+ DPRINTK("Bad page free for domain %u\n", d->id);
return i;
}
shadow_lock_init(d);
- d->domain = dom_id;
- d->processor = cpu;
+ d->id = dom_id;
+ d->processor = cpu;
d->create_time = NOW();
memcpy(&d->thread, &idle0_task.thread, sizeof(d->thread));
spin_lock_init(&d->pcidev_lock);
INIT_LIST_HEAD(&d->pcidev_list);
- if ( d->domain != IDLE_DOMAIN_ID )
+ if ( d->id != IDLE_DOMAIN_ID )
{
if ( (init_event_channels(d) != 0) || (grant_table_create(d) != 0) )
{
write_lock_irqsave(&tasklist_lock, flags);
pd = &task_list; /* NB. task_list is maintained in order of dom_id. */
for ( pd = &task_list; *pd != NULL; pd = &(*pd)->next_list )
- if ( (*pd)->domain > d->domain )
+ if ( (*pd)->id > d->id )
break;
d->next_list = *pd;
*pd = d;
d = task_hash[TASK_HASH(dom)];
while ( d != NULL )
{
- if ( d->domain == dom )
+ if ( d->id == dom )
{
if ( unlikely(!get_domain(d)) )
d = NULL;
{
struct domain *d;
- if ( current->domain == 0 )
+ if ( current->id == 0 )
BUG();
set_bit(DF_CRASHED, ¤t->flags);
{
struct domain *d;
- if ( current->domain == 0 )
+ if ( current->id == 0 )
{
extern void machine_restart(char *);
extern void machine_halt(void);
{
/* Initialise with magic marker if in DEBUG mode. */
void *a = map_domain_mem((page-frame_table)<<PAGE_SHIFT);
- memset(a, 0x80 | (char)d->domain, PAGE_SIZE);
+ memset(a, 0x80 | (char)d->id, PAGE_SIZE);
unmap_domain_mem(a);
}
#endif
if ( _atomic_read(old) != 0 )
return;
- DPRINTK("Releasing task %u\n", d->domain);
+ DPRINTK("Releasing task %u\n", d->id);
/* Delete from task list and task hashtable. */
write_lock_irqsave(&tasklist_lock, flags);
while ( *pd != d )
pd = &(*pd)->next_list;
*pd = d->next_list;
- pd = &task_hash[TASK_HASH(d->domain)];
+ pd = &task_hash[TASK_HASH(d->id)];
while ( *pd != d )
pd = &(*pd)->next_hash;
*pd = d->next_hash;
return -EPERM;
if ( dom1 == DOMID_SELF )
- dom1 = current->domain;
+ dom1 = current->id;
if ( dom2 == DOMID_SELF )
- dom2 = current->domain;
+ dom2 = current->id;
if ( ((d1 = find_domain_by_id(dom1)) == NULL) ||
((d2 = find_domain_by_id(dom2)) == NULL) )
goto out;
}
- d1->event_channel[port1].u.remote.dom = d2;
- d1->event_channel[port1].u.remote.port = (u16)port2;
+ d1->event_channel[port1].u.interdomain.remote_dom = d2;
+ d1->event_channel[port1].u.interdomain.remote_port = (u16)port2;
- d2->event_channel[port2].u.remote.dom = d1;
- d2->event_channel[port2].u.remote.port = (u16)port1;
- d2->event_channel[port2].state = ECS_INTERDOMAIN;
+ d2->event_channel[port2].u.interdomain.remote_dom = d1;
+ d2->event_channel[port2].u.interdomain.remote_port = (u16)port1;
+ d2->event_channel[port2].state = ECS_INTERDOMAIN;
out:
spin_unlock(&d1->event_channel_lock);
case ECS_INTERDOMAIN:
if ( d2 == NULL )
{
- d2 = chn1[port1].u.remote.dom;
+ d2 = chn1[port1].u.interdomain.remote_dom;
/* If we unlock d1 then we could lose d2. Must get a reference. */
if ( unlikely(!get_domain(d2)) )
goto again;
}
}
- else if ( d2 != chn1[port1].u.remote.dom )
+ else if ( d2 != chn1[port1].u.interdomain.remote_dom )
{
rc = -EINVAL;
goto out;
}
chn2 = d2->event_channel;
- port2 = chn1[port1].u.remote.port;
+ port2 = chn1[port1].u.interdomain.remote_port;
if ( port2 >= d2->max_event_channel )
BUG();
if ( chn2[port2].state != ECS_INTERDOMAIN )
BUG();
- if ( chn2[port2].u.remote.dom != d1 )
+ if ( chn2[port2].u.interdomain.remote_dom != d1 )
BUG();
chn2[port2].state = ECS_UNBOUND;
domid_t dom = close->dom;
if ( dom == DOMID_SELF )
- dom = current->domain;
+ dom = current->id;
else if ( !IS_PRIV(current) )
return -EPERM;
return -EINVAL;
}
- rd = ld->event_channel[lport].u.remote.dom;
- rport = ld->event_channel[lport].u.remote.port;
+ rd = ld->event_channel[lport].u.interdomain.remote_dom;
+ rport = ld->event_channel[lport].u.interdomain.remote_port;
evtchn_set_pending(rd, rport);
long rc = 0;
if ( dom == DOMID_SELF )
- dom = current->domain;
+ dom = current->id;
else if ( !IS_PRIV(current) )
return -EPERM;
break;
case ECS_INTERDOMAIN:
status->status = EVTCHNSTAT_interdomain;
- status->u.interdomain.dom = chn[port].u.remote.dom->domain;
- status->u.interdomain.port = chn[port].u.remote.port;
+ status->u.interdomain.dom = chn[port].u.interdomain.remote_dom->id;
+ status->u.interdomain.port = chn[port].u.interdomain.remote_port;
break;
case ECS_PIRQ:
status->status = EVTCHNSTAT_pirq;
u32 scombo, prev_scombo, new_scombo;
if ( unlikely((sflags & GTF_type_mask) != GTF_permit_access) ||
- unlikely(sdom != ld->domain) )
+ unlikely(sdom != ld->id) )
PIN_FAIL(GNTST_general_error,
"Bad flags (%x) or dom (%d). (NB. expected dom %d)\n",
- sflags, sdom, ld->domain);
+ sflags, sdom, ld->id);
/* Merge two 16-bit values into a 32-bit combined update. */
/* NB. Endianness! */
if ( op.dom == DOMID_SELF )
{
- op.dom = current->domain;
+ op.dom = current->id;
}
else if ( unlikely(!IS_PRIV(current)) )
{
if ( unlikely((t = rd->grant_table) == NULL) ||
unlikely(ref >= NR_GRANT_ENTRIES) )
{
- DPRINTK("Dom %d has no g.t., or ref is bad (%d).\n", rd->domain, ref);
+ DPRINTK("Dom %d has no g.t., or ref is bad (%d).\n", rd->id, ref);
return 0;
}
for ( ; ; )
{
if ( unlikely(sflags != GTF_accept_transfer) ||
- unlikely(sdom != ld->domain) )
+ unlikely(sdom != ld->id) )
{
DPRINTK("Bad flags (%x) or dom (%d). (NB. expected dom %d)\n",
- sflags, sdom, ld->domain);
+ sflags, sdom, ld->id);
goto fail;
}
memset(t, 0, sizeof(*t));
spin_lock_init(&t->lock);
- /* Active grant-table page. */
+ /* Active grant table. */
if ( (t->active = xmalloc(sizeof(active_grant_entry_t) *
NR_GRANT_ENTRIES)) == NULL )
goto no_mem;
+ memset(t->active, 0, sizeof(active_grant_entry_t) * NR_GRANT_ENTRIES);
if ( (t->maptrack = (void *)alloc_xenheap_page()) == NULL )
goto no_mem;
for ( i = 0; i < NR_MAPTRACK_ENTRIES; i++ )
t->maptrack[i].ref_and_flags = (i+1) << MAPTRACK_REF_SHIFT;
- /* Set up shared grant-table page. */
+ /* Shared grant table. */
if ( (t->shared = (void *)alloc_xenheap_page()) == NULL )
goto no_mem;
memset(t->shared, 0, PAGE_SIZE);
{
printk("Xen: DOM %u, CPU %d [has=%c] flags=%lx refcnt=%d nr_pages=%d "
"xenheap_pages=%d\n",
- d->domain, d->processor,
+ d->id, d->processor,
test_bit(DF_RUNNING, &d->flags) ? 'T':'F', d->flags,
atomic_read(&d->refcnt), d->tot_pages, d->xenheap_pages);
unlikely((d->tot_pages + (1 << order)) > d->max_pages) )
{
DPRINTK("Over-allocation for domain %u: %u > %u\n",
- d->domain, d->tot_pages + (1 << order), d->max_pages);
+ d->id, d->tot_pages + (1 << order), d->max_pages);
DPRINTK("...or the domain is dying (%d)\n",
!!test_bit(DF_DYING, &d->flags));
spin_unlock(&d->page_alloc_lock);
struct list_head *l;
VERBOSE_INFO("Checking if physdev-capable domain %u needs access to "
- "pfn %08lx\n", p->domain, pfn);
+ "pfn %08lx\n", p->id, pfn);
spin_lock(&p->pcidev_lock);
spin_unlock(&p->pcidev_lock);
VERBOSE_INFO("Domain %u %s mapping of pfn %08lx\n",
- p->domain, ret ? "allowed" : "disallowed", pfn);
+ p->id, ret ? "allowed" : "disallowed", pfn);
return ret;
}
* anyway if this write fails. Hopefully the printk will give us a
* clue what went wrong. */
INFO("Guest %u attempting sub-dword %s to BASE_ADDRESS %d\n",
- pdev->owner->domain, (acc == ACC_READ) ? "read" : "write", idx);
+ pdev->owner->id, (acc == ACC_READ) ? "read" : "write", idx);
return -EPERM;
}
p->lastschd = now;
/* DOM 0's parameters must be set here for it to boot the system! */
- if(p->domain == 0)
+ if(p->id == 0)
{
DOM_INFO(p)->remain = MILLISECS(15);
DOM_INFO(p)->nat_period =
{
struct at_dom_info *inf = DOM_INFO(sdom);
- ASSERT(sdom->domain != IDLE_DOMAIN_ID);
+ ASSERT(sdom->id != IDLE_DOMAIN_ID);
/* just delete it from all the queues! */
list_del(&inf->waitq);
/* MAW - the idle domain is always on the run queue. We run from the
* runqueue if it's NOT the idle domain or if there's nothing on the wait
* queue */
- if (cur_sdom->domain == IDLE_DOMAIN_ID && !list_empty(WAITQ(cpu)))
+ if (cur_sdom->id == IDLE_DOMAIN_ID && !list_empty(WAITQ(cpu)))
{
struct list_head *item;
ret.task = cur_sdom;
ret.time = newtime - time;
- TRACE_1D(0, cur_sdom->domain);
+ TRACE_1D(0, cur_sdom->id);
return ret;
}
{
d_inf = list_entry(list, struct at_dom_info, run_list);
d = d_inf->owner;
- printk("%3d: %d has=%c ", loop++, d->domain,
+ printk("%3d: %d has=%c ", loop++, d->id,
test_bit(DF_RUNNING, &d->flags) ? 'T':'F');
at_dump_runq_el(d);
printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time);
{
d_inf = list_entry(list, struct at_dom_info, waitq);
d = d_inf->owner;
- printk("%3d: %d has=%c ", loop++, d->domain,
+ printk("%3d: %d has=%c ", loop++, d->id,
test_bit(DF_RUNNING, &d->flags) ? 'T':'F');
at_dump_runq_el(d);
printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time);
inf->unwarp_timer.data = (unsigned long)inf;
inf->unwarp_timer.function = &unwarp_timer_fn;
- if ( d->domain == IDLE_DOMAIN_ID )
+ if ( d->id == IDLE_DOMAIN_ID )
{
inf->avt = inf->evt = ~0U;
}
DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d, "
"warpl=%lld, warpu=%lld\n",
- d->domain, inf->mcu_advance, inf->warpback, inf->warp_value,
+ d->id, inf->mcu_advance, inf->warpback, inf->warp_value,
inf->warpl, inf->warpu);
/* Sanity -- this can avoid divide-by-zero. */
DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d, "
"warpl=%lld, warpu=%lld\n",
- d->domain, inf->mcu_advance, inf->warpback, inf->warp_value,
+ d->id, inf->mcu_advance, inf->warpback, inf->warp_value,
inf->warpl, inf->warpu);
}
{
d_inf = list_entry(list, struct bvt_dom_info, run_list);
d = d_inf->domain;
- printk("%3d: %u has=%c ", loop++, d->domain,
+ printk("%3d: %u has=%c ", loop++, d->id,
test_bit(DF_RUNNING, &d->flags) ? 'T':'F');
bvt_dump_runq_el(d);
printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time);
static void rr_dump_domain(struct domain *d)
{
- printk("%u has=%c ", d->domain,
+ printk("%u has=%c ", d->id,
test_bit(DF_RUNNING, &d->flags) ? 'T':'F');
printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time);
}
/* Must be unpaused by control software to start execution. */
set_bit(DF_CTRLPAUSE, &d->flags);
- if ( d->domain != IDLE_DOMAIN_ID )
+ if ( d->id != IDLE_DOMAIN_ID )
{
/* Initialise the per-domain timer. */
init_ac_timer(&d->timer);
SCHED_OP(add_task, d);
- TRACE_2D(TRC_SCHED_DOM_ADD, d->domain, d);
+ TRACE_2D(TRC_SCHED_DOM_ADD, d->id, d);
}
void sched_rem_domain(struct domain *d)
{
rem_ac_timer(&d->timer);
SCHED_OP(rem_task, d);
- TRACE_2D(TRC_SCHED_DOM_REM, d->domain, d);
+ TRACE_2D(TRC_SCHED_DOM_REM, d->id, d);
}
void init_idle_task(void)
if ( likely(domain_runnable(d)) )
{
- TRACE_2D(TRC_SCHED_WAKE, d->domain, d);
+ TRACE_2D(TRC_SCHED_WAKE, d->id, d);
SCHED_OP(wake, d);
#ifdef WAKE_HISTO
d->wokenup = NOW();
/* Block the currently-executing domain until a pertinent event occurs. */
long do_block(void)
{
- ASSERT(current->domain != IDLE_DOMAIN_ID);
+ ASSERT(current->id != IDLE_DOMAIN_ID);
current->shared_info->vcpu_data[0].evtchn_upcall_mask = 0;
set_bit(DF_BLOCKED, ¤t->flags);
- TRACE_2D(TRC_SCHED_BLOCK, current->domain, current);
+ TRACE_2D(TRC_SCHED_BLOCK, current->id, current);
__enter_scheduler();
return 0;
}
/* Voluntarily yield the processor for this allocation. */
static long do_yield(void)
{
- TRACE_2D(TRC_SCHED_YIELD, current->domain, current);
+ TRACE_2D(TRC_SCHED_YIELD, current->id, current);
__enter_scheduler();
return 0;
}
add_ac_timer(&p->timer);
}
- TRACE_4D(TRC_SCHED_SET_TIMER, p->domain, p, timeout_hi, timeout_lo);
+ TRACE_4D(TRC_SCHED_SET_TIMER, p->id, p, timeout_hi, timeout_lo);
return 0;
}
if ( d == NULL )
return -ESRCH;
- TRACE_1D(TRC_SCHED_ADJDOM, d->domain);
+ TRACE_1D(TRC_SCHED_ADJDOM, d->id);
spin_lock_irq(&schedule_data[d->processor].schedule_lock);
SCHED_OP(adjdom, d, cmd);
}
#endif
- TRACE_2D(TRC_SCHED_SWITCH, next->domain, next);
+ TRACE_2D(TRC_SCHED_SWITCH, next->id, next);
switch_to(prev, next);
#ifndef VERBOSE
/* Only domain-0 may access the emergency console. */
- if ( current->domain != 0 )
+ if ( current->id != 0 )
return -EPERM;
#endif
#ifdef VERBOSE
#define SH_LOG(_f, _a...) \
printk("DOM%u: (file=shadow.c, line=%d) " _f "\n", \
- current->domain , __LINE__ , ## _a )
+ current->id , __LINE__ , ## _a )
#else
#define SH_LOG(_f, _a...)
#endif
#if SHADOW_DEBUG
#define SH_VLOG(_f, _a...) \
printk("DOM%u: (file=shadow.c, line=%d) " _f "\n", \
- current->domain , __LINE__ , ## _a )
+ current->id , __LINE__ , ## _a )
#else
#define SH_VLOG(_f, _a...)
#endif
#if 0
#define SH_VVLOG(_f, _a...) \
printk("DOM%u: (file=shadow.c, line=%d) " _f "\n", \
- current->domain , __LINE__ , ## _a )
+ current->id , __LINE__ , ## _a )
#else
#define SH_VVLOG(_f, _a...)
#endif
typedef struct event_channel_st
{
#define ECS_FREE 0 /* Channel is available for use. */
-#define ECS_UNBOUND 1 /* Channel is not bound to a particular source. */
+#define ECS_UNBOUND 1 /* Channel is waiting to bind to a remote domain. */
#define ECS_INTERDOMAIN 2 /* Channel is bound to another domain. */
#define ECS_PIRQ 3 /* Channel is bound to a physical IRQ line. */
#define ECS_VIRQ 4 /* Channel is bound to a virtual IRQ line. */
u16 state;
union {
struct {
- u16 port;
- struct domain *dom;
- } __attribute__ ((packed)) remote; /* state == ECS_CONNECTED */
+ domid_t remote_domid;
+ } __attribute__ ((packed)) unbound; /* state == ECS_UNBOUND */
+ struct {
+ u16 remote_port;
+ struct domain *remote_dom;
+ } __attribute__ ((packed)) interdomain; /* state == ECS_INTERDOMAIN */
u16 pirq; /* state == ECS_PIRQ */
u16 virq; /* state == ECS_VIRQ */
} u;
* From here on things can be added and shuffled without special attention
*/
- domid_t domain;
+ domid_t id;
s_time_t create_time;
spinlock_t page_alloc_lock; /* protects all the following fields */